<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>
    <div id="app">
        <!-- vue中的指令 自定义属性 -->
        <!-- 1. v-text -->
        <!-- 2. v-html -->
        <!-- 3. v-cloak-->
        <!-- 4. v-model(表单中使用)-->


        <!-- <div v-text="text"></div> -->

        <!-- <div v-cloak>
            {{ text + 'asdfgh' }}
        </div> -->

        <!-- <p>{{ message }}</p>
        <input v-model="message"> -->

        <!-- 语法糖 onchange -->
        <p>
            账号：<input v-model="username" type="text">
        </p>
        <p>
            密码：<input v-model="password" type="text">
        </p>
        <p>
            性别: <input v-model="sex" type="checkbox">
        </p>
        <p>
            <select v-model="val" name="" id="">
                <option value="11">内容1</option>
                <option value="22">内容2</option>
            </select>
        </p>
        <p>
            <button @click="sub">登录</button>
        </p>

        <!-- <div v-html="text"></div> -->
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>

    <script>
        let obj = {
            name: "张三"
        }
        console.log(obj)
    </script>

    <script>
        let app = new Vue({
            data: {
                text: "<h3>我是文字</h3>",
                message: 'Hello Vue!',
                username: "",
                password: "",
                sex: true,
                val: "",
                obj: {
                    name: "张三"
                }
            },
            methods: {
                sub() {
                    console.log(this.obj)
                }
            }
        })

        app.$mount('#app')
    </script>
</body>

</html>